<%@ include file="/WEB-INF/views/utils/includes.jsp" %>
<gf:layout>
    <gf:form>
    	
    	<gf:input value="true" path="enabled" hidden="true"/>
    	<tu:label text="label.name">
    		<gf:input value="${company.name}" path="name" required="true"/>
    	</tu:label>
    	<tu:label text="label.fiscalNumber">
    		<gf:input value="${company.fiscalNumber}" path="fiscalNumber" required="true" regexValidation="\\d{9}"/>
    	</tu:label>

        <table>
            <thead>
                <tr>
                    <td><tu:i18n value="label.address.street"/></td>
                    <td><tu:i18n value="label.address.postalCode"/></td>
                    <td><tu:i18n value="label.address.city"/></td>
                    <td>&nbsp;</td>
                </tr>
            </thead>
            <tbody>
<c:forEach var="address" items="${company.addresses}">
                <tr>
                    <td>${address.address}</td>
                    <td>${address.postalCode}</td>
                    <td>${address.city}</td>
                    <td><tu:action value="manage" method="post" url="${company.id}/address/${address.id}"/></td>
                    <td>
                    	<c:if test="${!address.mainAddress}">
                    		<tu:action value="default" method="post" url="${company.id}/address/${address.id}"/>
                    	</c:if>
                    </td>
                </tr>
</c:forEach>
            </tbody>
        </table>
    </gf:form>
</gf:layout>